<template>
  <div class="card">
    <div class="card_top">
      <div class="user_info">
        <div class="user_avater"><img src="@/assets/images/avatar.png" /></div>
        <div class="user_name">
          <div class="card_topping">
            <div class="topping">置顶</div>
            <div class="name">上官高高</div>
          </div>
          <div class="post">市场专员</div>
        </div>
      </div>
      <div class="more">
        <div class="date">2023/05/23</div>
        <div class="more_option" @click="show = true">
          <img src="@/assets/images/more_option.png" />
        </div>
      </div>
    </div>
    <div class="card_content">
      企业运营模式是网络经济兴起后的一个新热门话题作为企业生存赢利的关键要素和要素之间的逻辑关系，它决定着一个企业的市场经营成果经营
    </div>
    <div class="card_picture">
      <img src="@/assets/images/car.png" alt="" />
      <img src="@/assets/images/car.png" alt="" />
      <img src="@/assets/images/car.png" alt="" />
    </div>
    <div class="bottom">
      <div class="view_count">1122浏览</div>
      <div class="right">
        <div class="comment div" @click="goComment">
          <div class="img">
            <img src="@/assets/images/comment.png" />
          </div>
          <div class="comment_count text">1</div>
        </div>
        <div class="like div">
          <div class="img">
            <img src="@/assets/images/like.png" />
          </div>
          <div class="like_count text">1</div>
        </div>
      </div>
    </div>
  </div>
  <van-action-sheet v-model:show="show" :actions="actions" @select="onSelect" />
  <van-popup
    class="dynamic_popup"
    v-model:show="showBottom"
    round
    position="bottom"
  >
    <div class="popup_content">
      <div class="posting_dynamic label">
        <img src="@/assets/images/posting_updates.png" alt="" />
        <span class="content_text">发动态</span>
      </div>
      <div class="asking_question label">
        <img src="@/assets/images/asking_questions.png" alt="" />
        <span class="content_text">去提问</span>
      </div>
    </div>
  </van-popup>
</template>
<script>
import { Popup } from "vant";
import { ref } from "vue";
import { showToast } from "vant";
import { createApp } from "vue";
import { ActionSheet } from "vant";
const app = createApp();
app.use(ActionSheet);
export default {
  setup() {
    const show = ref(false);
    const actions = [{ name: "删除动态" }, { name: "取消" }];
    const onSelect = (item) => {
      // 默认情况下点击选项时不会自动收起
      // 可以通过 close-on-click-action 属性开启自动收起
      show.value = false;
      showToast(item.name);
    };

    return {
      show,
      actions,
      onSelect,
    };
  },
};
</script>
<style lang="scss">
.card {
  padding: 15px 16px;
  background-color: rgba(255, 255, 255, 1);
  border-radius: 8px;
  margin-bottom: 12px;
}
.card_top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}
.user_avater {
  border-radius: 50%;
  margin-right: 5px;
  img {
    width: 36px;
    height: 36px;
  }
}

.user_info {
  display: flex;
}
.topping {
  background-color: #00d0ab;
  color: #ffffff;
  font-size: 10px;
  line-height: 20px;
  padding: 0 5px;
  border-radius: 2px;
  font-family: PingFangSC-Regular;
  margin-right: 2px;
}
.card_topping {
  display: flex;
}
.name {
  font-size: 14px;
  line-height: 20px;
  font-family: PingFangSC-Medium;
}
.post {
  font-size: 12px;
  line-height: 17px;
  color: #898e8d;
}
.more {
  display: flex;
  height: 20px;
  img {
    vertical-align: middle;
    margin-left: 7px;
  }
}
.date {
  color: #676b6b;
  font-size: 14px;
  line-height: 20px;
}
.card_content {
  font-size: 14px;
  color: #272b2d;
  font-family: PingFangSC-Regular;
  line-height: 22px;
  margin-bottom: 10px;
}
.view_count {
  overflow-wrap: break-word;
  color: rgba(103, 107, 107, 1);
  font-size: 12px;
  font-family: PingFangSC-Regular;
  font-weight: normal;
  text-align: left;
  white-space: nowrap;
  line-height: 17px;
}
.card_picture {
  display: grid;
  grid-gap: 12px;
  grid-template-columns: 96px 96px 96px;
  img {
    width: 96px;
    height: 96px;
  }
}
.bottom {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
}
.right {
  display: flex;
  .div {
    display: flex;
  }
}
.bottom .right .div {
  margin-left: 20px;
  img {
    margin-right: 3px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
  }
  span {
    overflow-wrap: break-word;
    color: rgba(39, 43, 45, 1);
    font-size: 12px;
    font-family: PingFangSC-Regular;
    font-weight: normal;
    text-align: center;
    white-space: nowrap;
    line-height: 17px;
  }
}
.van-action-sheet__content {
  background-color: #fff;
  .van-action-sheet__item:first-child {
    color: red;
  }
}
.van-overlay {
  background: rgba($color: #000, $alpha: 0.3) !important;
}
.van-dropdown-item--down {
  margin-top: 12px;
}
.van-dropdown-item__content {
  background-color: #fff;
}
</style>
